package day_01.observer_mode;

public class Test {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditionDisplay display = new CurrentConditionDisplay(weatherData);

        weatherData.setMeasurements(80, 65, 30.4f);
        weatherData.setMeasurements(85, 70, 32.2f);
        weatherData.setMeasurements(86, 72, 36.3f);
        weatherData.setMeasurements(89, 76, 38.0f);

        System.out.println("==========================================");

        // 停止观察
        display.stopDisplay(weatherData);
        weatherData.setMeasurements(91, 77, 39.5f);
        weatherData.setMeasurements(97, 79, 40.2f);
    }
}
